'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;
  const jwtErr = middleware.jwtError(app.config.jwt);

  router.get('/', jwtErr, controller.home.index);
  router.post('/webtool/upload', jwtErr, controller.upload.index);
  router.post('/webtool/login', controller.login.index);
  router.resources('user', '/webtool/v1/user', controller.user);
  router.resources('project', '/webtool/v1/project', jwtErr, controller.project);
};
